package com.company;
import java.util.*;
import java.text.*;
public class dat {
    public static void main(String[] args) {
        Date date = new Date();
        SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss");
        System.out.println("当前时间为: " + ft.format(date)); // 当前时间为: 2019-03-31 05:03:39
        System.out.println(date.toString()); // Sun Mar 31 17:00:43 CST 2019
    }
}
